{% assign data = section.settings %}
{% assign blockId = block_id | default: section.block_id %}
<div
  class="block_slogan md:block flex items-center"
  id="block_slogan-{{blockId}}"
  style="--padding: {{data.padding.top}}px {{data.padding.right}}px {{data.padding.bottom}}px {{data.padding.left}}px;--bg-color: {{data.bg_color}};--text-color: {{data.text_color}};"
>
  <div class="container_wrapper">
    <ul class="list flex justify-between flex-wrap gap-y-[30px]">
      {% for block in section.blocks %}
        <li class="list_item md:w-[25%] w-[100%] box-border px-[22px] flex flex-col gap-4 items-center text-center">
          <div class="img_box ">
            {% if block.image.src != '' %}
              {% include 'lazy_img', src: block.image.src, alt: block.image.alt %}
            {% else %}
              {% include 'icon_slogan' slogan: block.icon %}
            {% endif %}
          </div>
          <div class="text_box">
            {% if block.title != '' %}
              <div class="item_title public_title">{{ block.title }}</div>
            {% endif %}
            {% if block.content != '' %}
              <div class="item_detail mt-2">{{ block.content }}</div>
            {% endif %}
          </div>
        </li>
      {% endfor %}
    </ul>
  </div>
</div>

<script>
  $(function () {
    $(`#block_slogan-{{blockId}}`).parent().prev().css('margin-bottom', `{{data.margin_top}}px`);
    $(`#block_slogan-{{blockId}}`).parent().css('margin-bottom', `{{data.margin_bottom}}px`);
  });
</script>

{% schema %}
{
	"name": {
		"zh_CN": "slogan",
		"en_US": "Slogan"
	},
	"tag": "",
	"class": "block_slogan",
	"max_blocks": "4",
	"is_global": false,
	"settings": [
		{
			"type": "card_header",
			"id": "",
			"label": {
				"zh_CN": "设置",
				"en_US": "Settings"
			}
		},
		{
			"type": "card_layout",
			"label": {
				"zh_CN": "内容留白",
				"en_US": "Content blank"
			},
			"id": "padding",
			"default": {
				"top": "0",
				"left": "0",
				"right": "0",
				"bottom": "0"
			}
		},
		{
			"type": "card_input_number",
			"max": 200,
			"min": 0,
			"id": "margin_top",
			"label": {
				"zh_CN": "上边距",
				"en_US": "Top margin"
			},
			"default": 80
		},
		{
			"type": "card_input_number",
			"max": 200,
			"min": 0,
			"id": "margin_bottom",
			"label": {
				"zh_CN": "下边距",
				"en_US": "Bottom margin"
			},
			"default": 80
		},
		{
			"type": "card_header",
			"id": "",
			"label": {
				"zh_CN": "颜色设置",
				"en_US": "Color Settings"
			}
		},
		{
			"type": "card_color",
			"id": "bg_color",
			"label": {
				"zh_CN": "背景颜色",
				"en_US": "Background color"
			},
			"show-alpha": "false",
			"color-format": "rgb",
			"default": "rgba(255,255,255,1)"
		},
		{
			"type": "card_color",
			"id": "text_color",
			"label": {
				"zh_CN": "文字颜色",
				"en_US": "Text color"
			},
			"default": "#000000"
		},
		{
			"type": "card_header",
			"id": "",
			"label": {
				"zh_CN": "内容",
				"en_US": "Content"
			}
		}
	],
	"blocks": [
		{
			"name": {
				"zh_CN": "slogan",
				"en_US": "Slogan"
			},
			"type": "slogan-item",
			"settings": [
				{
					"type": "card_select",
					"label": {
						"zh_CN": "选择图片",
						"en_US": "Select image"
					},
					"default": "oemsaas-wuliu",
					"id": "icon",
					"option": [
						{
							"label": {
								"zh_CN": "物流",
								"en_US": "Logistics"
							},
							"value": "oemsaas-wuliu",
							"icon": "shopyyicon-wuliu"
						},
						{
							"label": {
								"zh_CN": "货币",
								"en_US": "Money"
							},
							"value": "oemsaas-huobi",
							"icon": "shopyyicon-huobi"
						},
						{
							"label": {
								"zh_CN": "认证",
								"en_US": "Authentication"
							},
							"value": "oemsaas-renzheng",
							"icon": "shopyyicon-renzheng"
						},
						{
							"label": {
								"zh_CN": "全球交付",
								"en_US": "Global delivery"
							},
							"value": "oemsaas-quanqiujiaofu",
							"icon": "shopyyicon-quanqiujiaofu"
						},
						{
							"label": {
								"zh_CN": "买家保护",
								"en_US": "Buyer protection"
							},
							"value": "oemsaas-maijiabaohu",
							"icon": "shopyyicon-maijiabaohu"
						},
						{
							"label": {
								"zh_CN": "手机",
								"en_US": "Cell phone"
							},
							"value": "oemsaas-iphone",
							"icon": "shopyyicon-shouji"
						},
						{
							"label": {
								"zh_CN": "聊天",
								"en_US": "Chat"
							},
							"value": "oemsaas-liaotian",
							"icon": "shopyyicon-liaotian"
						},
						{
							"label": {
								"zh_CN": "信用卡",
								"en_US": "Credit card"
							},
							"value": "oemsaas-xinyongka",
							"icon": "shopyyicon-xinyongka"
						},
						{
							"label": {
								"zh_CN": "邮箱",
								"en_US": "Mailbox"
							},
							"value": "oemsaas-youxiang",
							"icon": "shopyyicon-youxiang"
						},
						{
							"label": {
								"zh_CN": "定位",
								"en_US": "Positioning"
							},
							"value": "oemsaas-dingwei",
							"icon": "shopyyicon-dingwei"
						},
						{
							"label": {
								"zh_CN": "问题",
								"en_US": "Problem"
							},
							"value": "oemsaas-wenti",
							"icon": "shopyyicon-wenti"
						},
						{
							"label": {
								"zh_CN": "笑脸",
								"en_US": "Smiley face"
							},
							"value": "oemsaas-xiaolian",
							"icon": "shopyyicon-xiaolian"
						},
						{
							"label": {
								"zh_CN": "店铺/房子",
								"en_US": "Shop/house"
							},
							"value": "oemsaas-dianpufangzi",
							"icon": "shopyyicon-a-dianpufangzi"
						},
						{
							"label": {
								"zh_CN": "礼物",
								"en_US": "The gift,"
							},
							"value": "oemsaas-liwu",
							"icon": "shopyyicon-liwu"
						},
						{
							"label": {
								"zh_CN": "爱心",
								"en_US": "Love"
							},
							"value": "oemsaas-aixin",
							"icon": "shopyyicon-aixin"
						},
						{
							"label": {
								"zh_CN": "折扣",
								"en_US": "Discount"
							},
							"value": "oemsaas-zhekou",
							"icon": "shopyyicon-zhekou"
						},
						{
							"label": {
								"zh_CN": "安全锁",
								"en_US": "Safety lock"
							},
							"value": "oemsaas-anquansuo",
							"icon": "shopyyicon-anquansuo"
						},
						{
							"label": {
								"zh_CN": "转换",
								"en_US": "Transform"
							},
							"value": "oemsaas-zhuanhuan",
							"icon": "shopyyicon-zhuanhuan"
						},
						{
							"label": {
								"zh_CN": "购物车",
								"en_US": "Shopping cart"
							},
							"value": "oemsaas-gouwuche",
							"icon": "shopyyicon-gouwuche"
						},
						{
							"label": {
								"zh_CN": "24h",
								"en_US": "24h"
							},
							"value": "oemsaas-a-24h",
							"icon": "shopyyicon-a-24h"
						},
						{
							"label": {
								"zh_CN": "商品",
								"en_US": "Product"
							},
							"value": "oemsaas-shangpin",
							"icon": "shopyyicon-shangpin"
						},
						{
							"label": {
								"zh_CN": "优惠券",
								"en_US": "Coupons"
							},
							"value": "oemsaas-youhuiquan",
							"icon": "shopyyicon-youhuiquan"
						},
						{
							"label": {
								"zh_CN": "客户群",
								"en_US": "Customer base"
							},
							"value": "oemsaas-kehuqun",
							"icon": "shopyyicon-kehuqun"
						},
						{
							"label": {
								"zh_CN": "编辑",
								"en_US": "Edit"
							},
							"value": "oemsaas-bainji",
							"icon": "shopyyicon-bianji"
						},
						{
							"label": {
								"zh_CN": "会员",
								"en_US": "Member"
							},
							"value": "oemsaas-huiyuan",
							"icon": "shopyyicon-huiyuan"
						},
						{
							"label": {
								"zh_CN": "航运",
								"en_US": "Shipping"
							},
							"value": "oemsaas-hangyun",
							"icon": "shopyyicon-hangyun"
						},
						{
							"label": {
								"zh_CN": "建筑",
								"en_US": "Architecture"
							},
							"value": "oemsaas-jianzhu",
							"icon": "shopyyicon-jianzhu"
						},
						{
							"label": {
								"zh_CN": "赞美",
								"en_US": "Praise"
							},
							"value": "oemsaas-zanmei",
							"icon": "shopyyicon-zanmei"
						},
						{
							"label": {
								"zh_CN": "视频",
								"en_US": "Video"
							},
							"value": "oemsaas-shipin",
							"icon": "shopyyicon-shipin"
						},
						{
							"label": {
								"zh_CN": "个性定制",
								"en_US": "Customization"
							},
							"value": "oemsaas-gexingdingzhi",
							"icon": "shopyyicon-gexingdingzhi"
						},
						{
							"label": {
								"zh_CN": "增长",
								"en_US": "Growth"
							},
							"value": "oemsaas-zengzhang",
							"icon": "shopyyicon-zengzhang"
						},
						{
							"label": {
								"zh_CN": "资料",
								"en_US": "Data"
							},
							"value": "oemsaas-ziliao",
							"icon": "shopyyicon-ziliao"
						},
						{
							"label": {
								"zh_CN": "学生",
								"en_US": "Student"
							},
							"value": "oemsaas-xuesheng",
							"icon": "shopyyicon-xuesheng"
						},
						{
							"label": {
								"zh_CN": "办公",
								"en_US": "Office"
							},
							"value": "oemsaas-bangong",
							"icon": "shopyyicon-bangong"
						},
						{
							"label": {
								"zh_CN": "模块",
								"en_US": "Module"
							},
							"value": "oemsaas-mokuai",
							"icon": "shopyyicon-mokuai"
						},
						{
							"label": {
								"zh_CN": "文件包",
								"en_US": "File package"
							},
							"value": "oemsaas-wenjianbao",
							"icon": "shopyyicon-wenjianbao"
						},
						{
							"label": {
								"zh_CN": "文件",
								"en_US": "File"
							},
							"value": "oemsaas-wenjian",
							"icon": "shopyyicon-wenjian"
						},
						{
							"label": {
								"zh_CN": "条约",
								"en_US": "The Treaty"
							},
							"value": "oemsaas-tiaoyue",
							"icon": "shopyyicon-tiaoyue"
						},
						{
							"label": {
								"zh_CN": "商务",
								"en_US": "Business"
							},
							"value": "oemsaas-shangwu",
							"icon": "shopyyicon-shangwu"
						},
						{
							"label": {
								"zh_CN": "分享",
								"en_US": "Share"
							},
							"value": "oemsaas-a-fenxiangfabu",
							"icon": "shopyyicon-a-fenxiangfabu"
						}
					]
				},
				{
					"type": "card_image",
					"label": {
						"zh_CN": "选择图片",
						"en_US": "Select image"
					},
					"info": {
						"zh_CN": "尺寸建议640*640px",
						"en_US": "Suggested size 640*640px"
					},
					"id": "image",
					"default": {
						"src": "",
						"alt": ""
					}
				},
				{
					"type": "card_input",
					"label": {
						"zh_CN": "标题",
						"en_US": "Title"
					},
					"id": "title",
					"default": "Worldwide Delivery"
				},
				{
					"type": "card_text_editor",
					"label": {
						"zh_CN": "内容",
						"en_US": "Content"
					},
					"id": "content",
					"default": ""
				}
			]
		}
	],
	"default": {
		"settings": {
			"padding": {
				"top": "0",
				"left": "0",
				"right": "0",
				"bottom": "0"
			},
			"margin_bottom": 80,
			"margin_top": 80,
			"bg_color": "rgba(255,255,255,1)",
			"text_color": "#000000"
		},
		"blocks": [
			{
				"icon": "oemsaas-wuliu",
				"image": {
					"src": "",
					"alt": ""
				},
				"title": "Worldwide Delivery",
				"content": "",
				"block_type": "slogan-item"
			},
			{
				"icon": "oemsaas-xinyongka",
				"image": {
					"src": "",
					"alt": ""
				},
				"title": "Safe Payment",
				"content": "",
				"block_type": "slogan-item"
			},
			{
				"icon": "oemsaas-renzheng",
				"image": {
					"src": "",
					"alt": ""
				},
				"title": "Buyer Protection",
				"content": "",
				"block_type": "slogan-item"
			},
			{
				"icon": "oemsaas-a-24h",
				"image": {
					"src": "",
					"alt": ""
				},
				"title": "24 Hours",
				"content": "",
				"block_type": "slogan-item"
			}
		]
	},
	"icon": "icon-slogan"
}
{% endschema %}
